//
//  ZCmainCell.m
//  zctx
//
//  Created by Yi luqi on 15/10/7.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCSamplingCell.h"
#import "ZCMainModel.h"

@implementation ZCSamplingCell

- (void)awakeFromNib {
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

-(void)setMainModel:(ZCMainModel *)mainModel{
    
    _mainModel = mainModel;
    
    self.nameLable.text =[NSString stringWithFormat:@"%@",_mainModel.pjname];
    self.locationLable.text = [NSString stringWithFormat:@"%@",_mainModel.location];
    
    
    if (_mainModel.institution) {
        self.institutionLable.text = [NSString stringWithFormat:@"%@",_mainModel.institution];
    }else{
//        NSLog(@"dsfadsfsa");
        self.institutionLable.text =@"";
    }
    
    NSURL *url =[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[NetworkManager strURLBasic],_mainModel.thumb]];
    [self.ImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeholderImg"]];
    NSString *state =[NSString stringWithFormat:@"%@",_mainModel.state];
    [self.stateButton setTitleColor:CellTextColor forState:UIControlStateNormal];
    if ([state isEqualToString:@"0"]) {
        [self.stateButton setTitle:@"审核中" forState:UIControlStateNormal];
    }else if([state isEqualToString:@"1"]){
        
    }else if([state isEqualToString:@"2"]) {
        //抽样中
        [self.stateButton setTitle:@"抽样中" forState:UIControlStateNormal];
    }else if ([state isEqualToString:@"3"]){
        //抽样完成
        [self.stateButton setTitle:@"抽样完成" forState:UIControlStateNormal];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
